package com.gdwstudy.enumExer;

/**
 * @author 关道伟
 * @version 1.0
 */
public class EnumExer01 {
    public static void main(String[] args) {
        //用枚举类.values()获取枚举数组
       Week week[] = Week.values();
       System.out.println("所有枚举信息如下：");
       //增强for循环 g
      for(Week week1:week){
           System.out.println(week1);
       }
    }
}

enum Week{
    MONDAY("星期一"),TUESDAT("星期二"),WEDNESDAY("星期三"),THURSDAY("星期四"),
    FRIDAY("星期五"),SATURDAY("星期六"),SUNDAY("星期日");

    private String name;

    private Week(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    @Override
    public String toString() {
        return name ;
    }
}
